<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/template/common/include/top.jsp"%>
<%@include file="/template/common/include/constant.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/template/js/gftuserfunc.js"></script>
<body>
  <div class="main1">当前的位置:角色管理</div>
  <form method="post" action="${pageContext.request.contextPath}/gftuser.x">
  <input type="hidden" name="op" value="findRole" />
  <div class="main_search">
    角色名称:<input type="text" name="f(roleName)" value="${fmap.roleName}" />
    角色描述:<input type="text" name="f(roleDesc)" value="${fmap.roleDesc}" />
    角色状态:
    <select name="f(status)">
      <option value="">全部</option>
      <option value="${status_yes}" <c:if test='${fmap.status == status_yes}'>selected</c:if>>正常</option>
      <option value="${status_no}" <c:if test='${fmap.status == status_no}'>selected</c:if>>禁用</option>
    </select>
    <input name="Submit" type="submit" class="search" value="搜索" />
  </div>
  </form>
  <div class="main_list">
    <div class="main_list_left">角色列表</div>
    <div class="main_edit">
      <input type="button" onclick="commit('listFrm',[['id_op','editRole']]);" value="添加" class="edit_ad" />
      <input type="button" onclick="if(confirm('是否要删除选中角色?')){commit('listFrm',[['id_op','deleteRole']])};" value="删除" class="edit_ad" />
    </div>
  </div>
  <form method="post" action="${pageContext.request.contextPath}/gftuser.x" id="listFrm" d_op="findRole">
  <input type="hidden" id="id_op" name="op" value="findRole" />
  <input type="hidden" id="id_r_id" name="r.id" />
  ${sys_searchparemeter}
    <div class="list_div">
    <table>
      <tr>
        <th width="2%"><input type="checkbox" onclick="checkByName('ids',this.checked);" /></th>
        <th width="24%"><a href="javascript:sort('roleName','listFrm');" id="sort_roleName" >角色名</a></th>
        <th width="21%"><a href="javascript:sort('roleDesc','listFrm');" id="sort_roleDesc" >角色描述</a></th>
        <th width="21%"><a href="javascript:sort('status','listFrm');" id="sort_status" >角色状态</a></th>
        <th width="10%">操作</th>
      </tr>
      <c:forEach items="${pageBean.retList}" var="row">
      <tr>
        <td>
          <input type="checkbox" name="ids" value="${row.id}" />
        </td>
        <td>${row.roleName}</td>
        <td>${row.roleDesc}</td>
        <td>
          <c:choose>
            <c:when test='${row.status == status_yes}'>正常</c:when>
            <c:otherwise>禁用</c:otherwise>
          </c:choose>
        </td>
        <td>
          <a href="javascript:commit('listFrm',[['id_op','editRole'],['id_r_id','${row.id}']]);"><img src="${pageContext.request.contextPath}/template/images/cz_2.gif" alt="编辑" border="0"></a>
          <a href="javascript:commit('listFrm',[['id_op','switchRoleStatus'],['id_r_id','${row.id}']]);">
            <c:choose>
              <c:when test='${row.status == status_yes}'><img src="${pageContext.request.contextPath}/template/images/cz_3.gif" alt="禁用" border="0"></c:when>
              <c:otherwise><img src="${pageContext.request.contextPath}/template/images/cz_4.gif" alt="恢复" border="0"></c:otherwise>
            </c:choose>
          </a>
          <a href="javascript:commit('listFrm',[['id_op','deleteRole']],check('ids','${row.id}'));" onclick="return confirm('是否要删除此条记录')"><img src="${pageContext.request.contextPath}/template/images/cz_1.gif" alt="删除" border="0"></a>
        </td>
      </tr>
      </c:forEach>
    </table>
    </div>
    <div class="main_page">
      <%@include file="/template/common/include/pagefooter.jsp"%>
    </div>
  </form>
</body>